package com.jyx.manage_course.service;

import com.jyx.framework.domain.portalview.PreViewCourse;
import com.jyx.manage_course.dao.PreViewCourseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class CourseViewService {
    @Autowired
    PreViewCourseRepository preViewCourseRepository;

    public PreViewCourse queryCourseViewById(String courseId) {
        Optional<PreViewCourse> optionalPreViewCourse = preViewCourseRepository.findById(courseId);
        if(!optionalPreViewCourse.isPresent()){
            return null;
        }
        return optionalPreViewCourse.get();
    }
}
